/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - Arr1
 * <p>Powered by webrx On 2021-11-26 10:08:19
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr1 {
    public static void main(String[] args) {
        //声明数组
        int[] arr = {10, 20, 30};
        var arr2 = new int[]{1, 2, 3, 4, 5, 6};
        String[] str = {"java", "php", "mysql"};
        var s2 = new String[3];//下标0 1 2
        var d2 = new double[3];//0.0
        var ss = "helloworld".split("");
        System.out.println(ss);
        //使用数组
        System.out.println(arr[0]);
        System.out.println(arr2[1]);
        System.out.println(str[2]);

        //引处有一个异常，下标超界
        //System.out.println(s2[3]);
        System.out.println(d2[2]);
        System.out.println(s2[0]);

        boolean[] bs = new boolean[3]; //默认值为false
        System.out.println(bs[0]);
        System.out.println(bs.length);//3
    }
}
